from src.utrls import DefUtrl


def run(notice_data: dict, group_id: int, operator_id: int, duration: int, user_id: int):
    """
    群禁言通知
    :param notice_data: 禁言通知数据
    :param group_id: 通知来源群
    :param operator_id: 被经验者QQ号
    :param duration: 被禁言的时间(时间戳)
    :param user_id: 操作者 QQ(发起禁言者)
    :return:
    """
    _time = notice_data["time"]  # 时间戳
    time_format = DefUtrl.format_timestamp(_time)
    if duration == 0:
        # 解除禁言
        tip = f"{time_format}_收到群【{group_id}】解禁言通知:操作者【{user_id}】,被禁言者:{operator_id}"
    else:
        # 禁言
        tip = f"{time_format}_收到群【{group_id}】禁言通知:操作者【{user_id}】,被禁言者:{operator_id}\n被禁言的时间(时间戳):{duration}秒"
    print(tip)
    DefUtrl.voice(tip)
